{% extends "base.html" %}
{% block css %}
<link rel="stylesheet" href="/static/css/admin.css" />
{% endblock %}
{% block nav %}
   <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container">

        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
        <a class="brand" href="/admin">Googler Admin</a>
        <div class="nav-collapse">
          <ul class="nav">

            <li class="active"><a href="/admin">Home</a></li>
            <li><a href="/admin/view_companies">Companies</a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
{% endblock %}

{% block content %}

<form class="form-horizontal" method="POST" action="/admin/addplaylists">
  <fieldset>
    <legend>{{ organization.name }}</legend>
    <div class="control-group">
      <label for="input01" class="control-label">PlaylistID</label>
      <div class="controls">
        <input type="text" name="playlist_ids" id="input01" class="input-xlarge">
        <input type="hidden" name="org_key" value="{{organization.key}}" id="input01" class="input-xlarge">
        <p class="help-block">Enter Youtube PlaylistId.</p>

      </div>
    </div>
    <div class="control-group">
      <label for="input01" class="control-label">Playlist Name</label>
      <div class="controls">
        <input type="text" name="playlist_name" class="input-xlarge">
        <p class="help-block">Enter name, this will show on the curation.</p>
      </div>
    </div>
<div class="form-actions">
             <button class="btn btn-primary" type="submit">Add Playlist</button>

          </div>
  </fieldset>
</form>


<h3>All Existing Playlists</h3>
<table class="table">
  {% for playlist in playlists %}
  <tr>
    <td>{{playlist.playlist.playlist_name}}</td>
 <td>{{playlist.playlist.playlistid }}</td>
    <td>
      <form action="/admin/addplaylists" method="post">
        <input type="hidden" name="org_key" value="{{organization.key}}">
        <input type="hidden" name="action" value="delete">
        <input type="hidden" name="playlist_ids" value="{{ playlist.playlist.playlistid}}">
        <button class="btn btn-primary" type="submit">Delete</button>
      </form>
</td>
  </tr>
  {% endfor %}
</table>



{% endblock %}
